home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 December / WPCDEC97.ISO / DXRS / INXWDEC.DXR / 00025_CDXSearch .ls < prev    next >
Encoding:
Text File  |  1997-10-13  |  4.7 KB  |  111 lines

  1. on CDXSearch
  2.   global CDXSearchBegin, CDXSearchSprite, CDXWhichTypesList, CDXresultlist, CDpageselect, CDrecordsfound, CDXSelected, CDXSub, CDXSomething, CDXWordsearchdata, CDXFirstResSprite, CDXLastResSprite, CDXHelpOnStage, CDXWhichIndex
  3.   if rollOver(CDXSearchSprite) or (CDXSub = 3) then
  4.     if CDXSearchBegin = 0 then
  5.       set the castNum of sprite CDXSearchSprite to the number of member "SearchNowTwo"
  6.       updateStage()
  7.     end if
  8.     repeat while rollOver(CDXSearchSprite) or (CDXSub = 3)
  9.       if (the mouseDown and (CDXSearchBegin = 0)) or (CDXSub = 3) then
  10.         if CDXSearchBegin = 0 then
  11.           set CDXSub to 2
  12.           set the castNum of sprite CDXSearchSprite to the number of member "SearchNowThree"
  13.           set CDXSearchBegin to 1
  14.           updateStage()
  15.         end if
  16.         exit repeat
  17.       end if
  18.     end repeat
  19.     if CDXSearchBegin = 0 then
  20.       set the castNum of sprite CDXSearchSprite to the number of member "SearchNowOne"
  21.     else
  22.       if CDXSearchBegin = 1 then
  23.         repeat with a = 30 to 35
  24.           set the castNum of sprite a to the number of member "CDDot"
  25.           set the locH of sprite a to 2000
  26.           set the locV of sprite a to 2000
  27.         end repeat
  28.         set the castNum of sprite 36 to the number of member "CDDot"
  29.         set the locH of sprite 36 to 2000
  30.         set CDXHelpOnStage to 0
  31.         repeat with a = CDXFirstResSprite to CDXLastResSprite
  32.           set the castNum of sprite a to -1
  33.           set the locH of sprite a to 2000
  34.           set the locV of sprite a to 2000
  35.         end repeat
  36.         updateStage()
  37.         set CDXWordsearchdata to 0
  38.         set CDcountwords to the number of words in field "CDWordSearchField"
  39.         set CDXWordsearchdata to word 1 to CDcountwords of line 1 of field "CDWordSearchField"
  40.         set CDXWhichTypesList to list()
  41.         set CDpageselect to 0
  42.         repeat with d = 1 to count(WhichInxTopMenuList)
  43.           set selectedtext to getAt(getAt(WhichInxTopMenuList, d), 4)
  44.           if getAt(getAt(WhichInxTopMenuList, d), 14) = "MG_RATE" then
  45.             set wordNum to 1
  46.           else
  47.             set wordNum to the number of words in field selectedtext
  48.           end if
  49.           if wordNum > 1 then
  50.             set WhichSel to word 1 of field selectedtext && word 2 of field selectedtext
  51.           else
  52.             set WhichSel to word 1 of field selectedtext
  53.           end if
  54.           if (WhichSel <> EMPTY) and (WhichSel <> "select all") and (WhichSel <> "all") and (WhichSel <> "select") then
  55.             repeat with g = 1 to the number of chars in WhichSel
  56.               put charToNum(char g of WhichSel)
  57.               if (charToNum(char g of WhichSel) > 96) and (charToNum(char g of WhichSel) < 123) then
  58.                 set currentasciivalue to charToNum(char g of WhichSel)
  59.                 set currentasciivalue to currentasciivalue - 32
  60.                 put numToChar(currentasciivalue) into char g of WhichSel
  61.               end if
  62.             end repeat
  63.             add(CDXWhichTypesList, [getAt(getAt(WhichInxTopMenuList, d), 14), WhichSel])
  64.           end if
  65.         end repeat
  66.         if (count(CDXWhichTypesList) > 0) or (CDXWordsearchdata <> EMPTY) then
  67.           set CDXSelected to 1
  68.           set CDXresultlist to list()
  69.           CDXBeginFileFlexSearching()
  70.         else
  71.           set the castNum of sprite 34 to the number of member "CDNothingSel"
  72.           set the boxType of member "CDNothingSel" to #fixed
  73.           set the margin of member "CDNothingSel" to 2
  74.           set the border of member "CDNothingSel" to 1
  75.           if the machineType > 200 then
  76.             set the textFont of member "CDNothingSel" to "arial"
  77.           else
  78.             set the textFont of member "CDNothingSel" to "Geneva"
  79.           end if
  80.           set the textStyle of member "CDNothingSel" to "plain"
  81.           set the textSize of member "CDNothingSel" to 12
  82.           set the loc of sprite 34 to point(30, 134)
  83.           set the castNum of sprite 35 to the number of member "NothingGraphic"
  84.           set the loc of sprite 35 to point(217, 156)
  85.           updateStage()
  86.           set CDXSelected to 0
  87.         end if
  88.         set CDrecordsfound to count(CDXresultlist)
  89.         if CDrecordsfound > 18 then
  90.           set CDpageselect to 1
  91.         end if
  92.         if (CDXSelected = 1) and (CDXSomething = 1) then
  93.           case CDXWhichIndex of
  94.             1:
  95.               CDXFieldResults()
  96.               CDXdisplay()
  97.             2:
  98.               PRODFieldResults()
  99.               PRODdisplay()
  100.           end case
  101.         end if
  102.         repeat while the mouseDown
  103.         end repeat
  104.         set the castNum of sprite CDXSearchSprite to the number of member "SearchNowOne"
  105.         set CDXSearchBegin to 0
  106.       end if
  107.     end if
  108.     updateStage()
  109.   end if
  110. end
  111.